<template>
	<view>
		<view class="image-container">
			<image :src="region.picture" style="width: 100%;margin: 0 auto;"></image>
		</view>
		<u-cell-group>
			<u-cell size="large" title="区域名称" :value="region.regionName">
			</u-cell>
			<u-cell size="large" title="区域简介" :value="region.descrip">
			</u-cell>
		</u-cell-group>
		<text>包含器械</text>
		<u-cell-group>
			<u-cell v-for="(item,i) in region.equipList" :key="i" :icon="item.picture" arrow-direction="right"
				iconStyle="width:90px;height:90px" isLink :url="'/pages/equip/equip?id='+item.id">
				<text slot="value">{{item.equipName}}</text></u-cell>
		</u-cell-group>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				region: {}
			};
		},
		onLoad(options) {
			if (options.id) {
				this.getById(options.id)
			}

		},
		methods: {
			async getById(id) {
				let {
					data: res
				} = await uni.$http.get('/user/region/' + id)
				if (res.code === 20000) {
					this.region = res.data
				} else {
					uni.$showMsg(res.msg)
				}
			},
		}
	}
</script>

<style lang="scss">

</style>